package com.hbmcc.rxjava.chapter01.adapter

import androidx.recyclerview.widget.RecyclerView.*
import com.alibaba.android.vlayout.RecyclablePagerAdapter
import com.hbmcc.rxjava.chapter01.adapter.base.SubAdapter
import com.hbmcc.rxjava.chapter01.holder.PagerHolder

/**
 * 创建日期：2020/11/11
 * 描述:Banner的item
 * 作者:支豪亮
 */
@Suppress("UNCHECKED_CAST")
class ProxyPagerItemAdapter(
    pool: RecycledViewPool,
    private var adapter: SubAdapter<PagerHolder, String>
) : RecyclablePagerAdapter<PagerHolder>(adapter as Adapter<PagerHolder>, pool) {

    override fun getCount(): Int {
        return adapter.itemCount
    }

    override fun onBindViewHolder(pagerHolder: PagerHolder, position: Int) {
        adapter.onBindViewHolder(pagerHolder,position)
    }

    override fun getItemViewType(position: Int): Int {
        return position
    }



}